#ifndef __MACRO_H__
#define __MACRO_H__

#include "Header.h"


//Max BufferSize
#define MAX_BUFFER_LENGTH	255

//Include lib for target platform
#define STRINGIFY(x)	#x
#define TOSTRING(x)		STRINGIFY(x)

//Include OpenGL lib
#if (CURRENT_PLATFORM == PLATFORM_WIN32_VS  || CURRENT_PLATFORM == PLATFORM_ANDROID)
#	include <GLES2/gl2.h>
#	include <EGL/egl.h>
#endif //PLATFORM_WIN32_VS || PLATFORM_ANDROID

//Include Std lib
#if (CURRENT_PLATFORM == PLATFORM_WIN32_VS  || CURRENT_PLATFORM == PLATFORM_ANDROID)
#	include <stdio.h>
#	include <conio.h>
#	include <tchar.h>
#endif //PLATFORM_WIN32_VS || PLATFORM_ANDROID

#if (CURRENT_PLATFORM == PLATFORM_WIN32_VS)
#	include <Windows.h>
#	include <time.h>
#	define TODO(x) __pragma(message("[TODO]:" __FILE__ "("TOSTRING(__LINE__)")" TOSTRING(x)));// Log(x);
#endif //PLATFORM_WIN32_VS

#if (CURRENT_PLATFORM == PLATFORM_ANDROID)
#
#endif //PLATFORM_ANDROID

//Define macro safe release memory
#define SAFE_DEL(p)				if (p){delete p; p = 0;}
#define SAFE_DEL_ARRAY(p)		if (p){delete[] p; p = 0;}
#define SAFE_DEL_ARRAY_POINTER(p,n) if(p){for(int i=0; i<n; i++){if(p[i]){delete p[i]; p[i] = 0;}}}
#define VECTOR_FUNC(v, n, func)	{for(int i=0; i<n; i++){if(v[i]){v[i]->func();}}}

//Variable
#if (CURRENT_PLATFORM == PLATFORM_WIN32_VS || CURRENT_PLATFORM == PLATFORM_ANDROID)
//Interger type
typedef	unsigned long long			__UINT64;
typedef long long					__INT64;
typedef unsigned int				__UINT32;
typedef int							__INT32;
typedef	unsigned short				__UINT16;
typedef short						__INT16;
typedef	unsigned char				__UINT8;
typedef char						__INT8;
//Boolean type
typedef bool						__BOOL;
//Void type
typedef void						__VOID;
//float type
typedef float						__FLOAT;
#endif //PLATFORM_WIN32_VS || PLATFORM_ANDROID

#endif